<!--设置vip/svip组件-->
<template>
	<div>
		<p class="filter"></p>
		<div class="addBox" >
			<h3 class="fixTitle"><span v-if="vipType==2">设置vip</span><span v-else>设置svip</span>
				<p>
					<em style="cursor: pointer;" ><svg-icon icon-class="jian" class="font-size16"/></em><em style="cursor: pointer;"><svg-icon class="font-size16" icon-class="fullScreen" /></em><em style="cursor: pointer;" @click="close"><svg-icon icon-class="cha" class="font-size16" /></em>
				</p>
			</h3>
			<div style="margin: 70px 50px 10px;">
				<el-radio v-for="(item, index) in companyMemberPrice" v-if="item.vipType == vipType" v-model="radio" :label="item.duration" :disabled="item.status != 1" :key="index">
					<span v-if="item.duration == 1">月</span>
					<span v-if="item.duration == 3">季度</span>
					<span v-if="item.duration == 6">半年</span>
					<span v-if="item.duration == 12">年</span>
				</el-radio>
			</div>
			<p style="text-align: center;padding: 20px 0;">
				<el-button type="primary" icon="el-icon-check" @click="confirm">确认</el-button>
	  			<el-button type="info" @click="close">取消</el-button>
			</p>
		</div>
	</div>
</template>
<script>
  export default {
    data() {
      return {
        radio: null
      }
    },
    props: ['vipType', 'companyMemberPrice'],
    methods: {
      close() {
        this.$emit('hideVip', false)
      },
      confirm() {
      if (!this.radio) {
        this.$message({
          type: 'warning',
          message: '请选择！'
        })
        return false
      }
        this.$emit('confirm', this.radio)
      }
    }
  }
</script>
<style scoped>
	p,h3 {margin:0;padding:0}
	h3 em{
		padding: 0 5px;
		font-style: normal;
	}
	h3 em:hover{
		color: #0E90D2;
	}
	.font-size16{
		font-size: 16px;
	}
	.fixTitle{
		font-weight: 500;
		font-size: 14px;
		height: 36px;
		background: #eee;
		border-bottom: 1px solid #ddd;
		position: fixed;
		width: 400px;
		line-height: 36px;
		padding: 0 10px;
		z-index: 98;
	}
	.fixTitle p{
		position: absolute;
		right: 20px;
		top: 0px;
	}
	.filter {
		width: 100%;
		height: 100%;
		background: rgba(0,0,0,.3);
		position: fixed;
		left: 0;
		top: 0;
		z-index: 90;
	}
	.addBox {
		width: 400px;
		height: 200px;
		overflow: auto;
		background: #fff;
		position: fixed;
		left: 35%;
		top: 30%;
		z-index: 101;
	}
	table{
		width: 100%;
		border: 1px solid #eee;
		border-spacing: 0;
		border-collapse: collapse;
	}
	td{
		border: 1px solid #eee;
		line-height: 50px;
		padding-left: 10px;
	}
	.leftTd{
		width: 30%;
	}
	.rightTd{
		width: 70%;
	}
</style>
